package a.a;

import a.c.a;
import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.q;
import a.c.w;
import a.c.*;
import a.c.z;
import a.i.db;

import java.util.Arrays;

public class kb
{
  public static int a;
  
  public static ab[] a(q paramq)
  {
    return a(paramq, b(paramq));
  }
  
  public static ab[] a(q paramq, bb[] paramArrayOfbb)
  {
    int k = m.b;
    boolean bool = m.a;
    ab[] arrayOfab = new ab[paramArrayOfbb.length];
    int[] arrayOfInt = new int[paramq.k()];
    int i = 1;
    int j = 0;
    label116:
    label123:
    do
    {
      if (j >= paramArrayOfbb.length) {
        break;
      }
      bb localbb = paramArrayOfbb[j];
      ab localab = new ab();
      w localw = localbb.l();
      do
      {
        do
        {
          if (!localw.e()) {
            break;
          }
          arrayOfInt[localw.d().f()] = i;
          localw.f();
          if (k != 0) {
            break label123;
          }
          if (bool) {
            break label116;
          }
        } while (!bool);
      } while (k != 0);
      localw = localbb.l();
      do
      {
        if (!localw.e()) {
          break label243;
        }
        e locale = localw.d();
        if (k != 0) {
          break label262;
        }
        if (bool) {
          break label260;
        }
        a.c.m localm = locale.n();
        do
        {
          do
          {
            if (!localm.e()) {
              break label226;
            }
            d locald = localm.a();
            if (bool) {
              break;
            }
            if (arrayOfInt[locald.a(locale).f()] == i)
            {
              if (k != 0) {
                continue;
              }
              if (!locald.g()) {
                localab.c(locald);
              }
            }
            localm.f();
          } while (!bool);
          localw.f();
        } while (k != 0);
      } while (!bool);
      arrayOfab[j] = localab;
      j++;
      if (k == 0) {
        i++;
      }
    } while (!bool);
    label226:
    label243:
    return arrayOfab;
  }
  
  public static bb[] b(q paramq)
  {
    int k = m.b;
    boolean bool = m.a;
    int[] arrayOfInt = new int[paramq.k()];
    z localz = new z();
    bb localbb1 = new bb();
    int i = 0;
    Object localObject = paramq.v();
    e locale1;
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      locale1 = ((w)localObject).d();
      arrayOfInt[locale1.f()] = locale1.e();
      if (bool) {
        break label128;
      }
      if (locale1.e() == 0)
      {
        if (k != 0) {
          continue;
        }
        if (locale1.d() == 1) {
          localbb1.b(locale1);
        }
      }
      ((w)localObject).f();
    } while (!bool);
    label128:
    do
    {
      do
      {
        do
        {
          do
          {
            if ((k == 0) && (localbb1.isEmpty())) {
              break;
            }
            locale1 = localbb1.o();
            do
            {
              if (locale1.d() <= 0) {
                break;
              }
              localObject = locale1.i().e();
              arrayOfInt[((e)localObject).f()] -= 1;
            } while (k != 0);
          } while ((k == 0) && (((e)localObject).d() > 1));
          if (k != 0) {
            break;
          }
        } while (arrayOfInt[localObject.f()] != 0);
      } while (k != 0);
      localbb1.b(localObject);
    } while (!bool);
    localObject = paramq.v();
    label331:
    label465:
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      locale1 = ((w)localObject).d();
      int j = arrayOfInt[locale1.f()];
      bb localbb2;
      if (k == 0) {
        if (j == 0)
        {
          if (k != 0) {
            break label331;
          }
          if (locale1.d() != 1)
          {
            if (k != 0) {
              break label331;
            }
            if (locale1.e() > 0)
            {
              localbb2 = new bb();
              localbb2.b(locale1);
              a(locale1, localbb2);
              localz.b(localbb2);
              if (k != 0) {
                continue;
              }
              if (!bool) {
                break label465;
              }
            }
          }
        }
      }
      if (k == 0)
      {
        if (j > 0)
        {
          if (k != 0) {
            continue;
          }
          if (j < locale1.e())
          {
            localbb2 = new bb();
            do
            {
              localbb2.b(locale1);
              w localw = locale1.q();
              do
              {
                if (!localw.e()) {
                  break label453;
                }
                e locale2 = localw.d();
                if (bool) {
                  break;
                }
                if (arrayOfInt[locale2.f()] == 0)
                {
                  if (k != 0) {
                    continue;
                  }
                  if (locale2.d() == 1)
                  {
                    localbb2.b(locale2);
                    a(locale2, localbb2);
                  }
                }
                localw.f();
              } while (!bool);
            } while (k != 0);
            localz.b(localbb2);
          }
        }
        ((w)localObject).f();
      }
    } while (!bool);
    label453:
    return (bb[])localz.toArray(new bb[localz.size()]);
  }
  
  public static bb[] c(q paramq)
  {
    int m = m.b;
    boolean bool = m.a;
    bb[] arrayOfbb = new bb[paramq.k()];
    ab[] arrayOfab = new ab[paramq.k()];
    z localz = new z();
    bb localbb = new bb();
    int i = 0;
    do
    {
      while (!bool)
      {
        if (i >= paramq.k()) {
          break;
        }
        arrayOfbb[i] = new bb();
        i++;
      }
    } while (m != 0);
    Object localObject = paramq.v();
    label234:
    label236:
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      int j = ((w)localObject).d().f();
      arrayOfbb[j] = new bb();
      arrayOfab[j] = new ab();
      if (m != 0) {
        break label404;
      }
      if (bool) {
        break label399;
      }
      a.c.m localm = ((w)localObject).d().l();
      do
      {
        do
        {
          if (!localm.e()) {
            break;
          }
          arrayOfab[j].add(localm.a());
          localm.f();
          if (m != 0) {
            break label236;
          }
          if (bool) {
            break label234;
          }
        } while (!bool);
      } while (m != 0);
      if (arrayOfab[j].size() == 1) {
        localbb.b(((w)localObject).d());
      }
      ((w)localObject).f();
    } while (!bool);
    do
    {
      do
      {
        e locale2;
        do
        {
          e locale1;
          do
          {
            if (localbb.isEmpty()) {
              break;
            }
            locale1 = localbb.o();
          } while ((m == 0) && (arrayOfab[locale1.f()].size() == 0));
          localObject = arrayOfab[locale1.f()].l().a();
          locale2 = ((d)localObject).a(locale1);
          arrayOfbb[locale2.f()].a(arrayOfbb[locale1.f()]);
          arrayOfbb[locale2.f()].b(locale1);
          arrayOfab[locale2.f()].remove(localObject);
        } while (arrayOfab[locale2.f()].size() != 1);
        localbb.b(locale2);
      } while (m != 0);
    } while (!bool);
    localObject = paramq.v();
    label399:
    label404:
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      int k = ((w)localObject).d().f();
      if (m != 0) {
        break label470;
      }
      if (bool) {
        break label466;
      }
      if (m == 0)
      {
        if (arrayOfbb[k].size() > 0)
        {
          arrayOfbb[k].a(((w)localObject).d());
          localz.add(arrayOfbb[k]);
        }
        ((w)localObject).f();
      }
    } while (!bool);
    label466:
    label470:
    return (bb[])localz.toArray(new bb[localz.size()]);
  }
  
  public static boolean a(q paramq, int paramInt)
  {
    int i = m.b;
    boolean bool = m.a;
    if (i == 0) {
      if (d(paramq))
      {
        do
        {
          w localw = paramq.v();
          while (!bool)
          {
            if (!localw.e()) {
              break;
            }
            if ((i == 0) && (bool)) {
              break label75;
            }
            if (localw.d().e() > paramInt) {
              return false;
            }
            localw.f();
          }
        } while (i != 0);
        label75:
        return true;
      }
    }
    return false;
  }
  
  public static boolean d(q paramq)
  {
    int i = m.b;
    boolean bool2 = m.a;
    if (i == 0) {
      if (paramq.n()) {
        return true;
      }
    }
    if (i == 0) {
      if (paramq.j() != paramq.l() + 1) {
        return false;
      }
    }
    boolean bool1 = false;
    w localw = paramq.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      if (bool2) {
        break label137;
      }
      if (locale.d() == 0)
      {
        if (i == 0)
        {
          if (bool1) {
            return false;
          }
          bool1 = true;
        }
        if (i != 0) {
          continue;
        }
        if (!bool2) {}
      }
      else
      {
        if (i != 0) {
          continue;
        }
        if (locale.d() != 1) {
          return false;
        }
      }
      localw.f();
    } while (!bool2);
    if ((i == 0) && (!m.c(paramq))) {
      label137:
      return false;
    }
    return bool1;
  }
  
  public static boolean e(q paramq)
  {
    int i = m.b;
    if (i == 0) {
      if (paramq.n()) {
        return true;
      }
    }
    if ((i != 0) || (paramq.j() != paramq.l() + 1)) {
      return false;
    }
    b_ localb_ = new b_();
    try
    {
      localb_.a(paramq);
      return true;
    }
    catch (a locala) {}
    return false;
  }
  
  public static boolean f(q paramq)
  {
    int i = m.b;
    boolean bool2 = m.a;
    if (i == 0) {
      if (paramq.n()) {
        return true;
      }
    }
    boolean bool1 = false;
    w localw = paramq.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      if (bool2) {
        break label98;
      }
      if (locale.d() == 0)
      {
        bool1 = true;
        if (i != 0) {
          continue;
        }
        if (!bool2) {}
      }
      else
      {
        if (i != 0) {
          continue;
        }
        if (locale.d() != 1) {
          return false;
        }
      }
      localw.f();
    } while (!bool2);
    label98:
    return bool1;
  }
  
  public static bb a(q paramq, boolean paramBoolean)
  {
    int i = m.b;
    boolean bool = m.a;
    bb localbb = new bb();
    w localw = paramq.v();
    label85:
    label91:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      if (i == 0) {
        if (paramBoolean)
        {
          if (i != 0) {
            break label91;
          }
          if (locale.e() == 0) {
            break label85;
          }
        }
      }
      if (i == 0)
      {
        if (!paramBoolean)
        {
          if (i != 0) {
            continue;
          }
          if (locale.c() == 1) {
            localbb.add(locale);
          }
        }
        localw.f();
      }
    } while (!bool);
    return localbb;
  }
  
  public static e g(q paramq)
  {
    if (m.b == 0) {
      if (paramq.j() == 1) {
        return paramq.p();
      }
    }
    bb[] arrayOfbb = b.a(paramq, a(paramq, false));
    return arrayOfbb[(arrayOfbb.length - 1)].m();
  }
  
  public static e h(q paramq)
  {
    int j = m.b;
    boolean bool = m.a;
    w localw = paramq.v();
    e locale = null;
    int i = 0;
    localw.h();
    do
    {
      if (!localw.e()) {
        break;
      }
      if (j != 0) {
        break label84;
      }
      if (bool) {
        break label83;
      }
      if (localw.d().d() == 0)
      {
        locale = localw.d();
        i++;
      }
      localw.f();
    } while (!bool);
    if (j == 0)
    {
      label83:
      if (i == 1) {
        label84:
        return locale;
      }
      i = 0;
    }
    localw.h();
    do
    {
      if (!localw.e()) {
        break;
      }
      if (j != 0) {
        break label156;
      }
      if (bool) {
        break label155;
      }
      if (localw.d().e() == 0)
      {
        locale = localw.d();
        i++;
      }
      localw.f();
    } while (!bool);
    label155:
    if ((j == 0) && (i == 1)) {
      label156:
      return locale;
    }
    return j(paramq);
  }
  
  public static ab i(q paramq)
  {
    return a(paramq, h(paramq));
  }
  
  public static e j(q paramq)
  {
    int[] arrayOfInt = new int[paramq.k()];
    x localx = db.a(arrayOfInt);
    return a(paramq, localx);
  }
  
  public static e a(q paramq, x paramx)
  {
    int i = m.b;
    boolean bool = m.a;
    e locale = paramq.p();
    e[] arrayOfe = new e[1];
    int[] arrayOfInt = new int[paramq.k()];
    Arrays.fill(arrayOfInt, -1);
    ab localab = a(paramq, locale);
    a(locale, paramx, arrayOfe, arrayOfInt, -1);
    a.c.m localm = localab.l();
    do
    {
      while (!bool)
      {
        if (!localm.e()) {
          break;
        }
        paramq.e(localm.a());
        localm.f();
      }
    } while (i != 0);
    return arrayOfe[0];
  }
  
  private static int a(e parame, x paramx, e[] paramArrayOfe, int[] paramArrayOfInt, int paramInt)
  {
    int m = m.b;
    boolean bool = m.a;
    int i = 0;
    d locald1 = parame.h();
    do
    {
      if (locald1 == null) {
        break;
      }
      localObject = locald1.f();
      int k = a((e)localObject, paramx, paramArrayOfe, paramArrayOfInt, paramInt);
      if (m != 0) {
        break label108;
      }
      if (bool) {
        break label107;
      }
      if (k > paramInt) {
        paramInt = k;
      }
      i += paramArrayOfInt[localObject.f()];
      locald1 = locald1.i();
    } while (!bool);
    if (m == 0) {}
    label107:
    label108:
    int j = i * (parame.g().j() - 1 - i);
    Object localObject = parame.h();
    label211:
    label213:
    do
    {
      if (localObject == null) {
        break;
      }
      e locale1 = ((d)localObject).f();
      if (m != 0) {
        break label242;
      }
      if (bool) {
        break label240;
      }
      d locald2 = ((d)localObject).i();
      do
      {
        do
        {
          if (locald2 == null) {
            break;
          }
          e locale2 = locald2.f();
          j += paramArrayOfInt[locale1.f()] * paramArrayOfInt[locale2.f()];
          locald2 = locald2.i();
          if (m != 0) {
            break label213;
          }
          if (bool) {
            break label211;
          }
        } while (!bool);
      } while (m != 0);
      localObject = ((d)localObject).i();
    } while (!bool);
    paramx.a(parame, j);
    if (m == 0) {
      paramArrayOfInt[parame.f()] = (i + 1);
    }
    label240:
    label242:
    if (m == 0) {
      if (j > paramInt)
      {
        paramInt = j;
        paramArrayOfe[0] = parame;
      }
    }
    return paramInt;
  }
  
  public static ab a(q paramq, e parame)
  {
    int i = m.b;
    boolean bool = m.a;
    ab localab = new ab();
    h local0 = new h()
    {
      private final ab val$reversed;
      
      protected void a(d paramAnonymousd, e paramAnonymouse, boolean paramAnonymousBoolean)
      {
        if ((paramAnonymousBoolean) && (paramAnonymousd.e() == paramAnonymouse)) {
          this.val$reversed.c(paramAnonymousd);
        }
      }
    };
    local0.a(false);
    local0.a(paramq, parame);
    a.c.m localm = localab.l();
    do
    {
      while (!bool)
      {
        if (!localm.e()) {
          break;
        }
        paramq.e(localm.a());
        localm.f();
      }
    } while (i != 0);
    return localab;
  }
  
  private static void a(e parame, bb parambb)
  {
    boolean bool = m.a;
    w localw = parame.q();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      parambb.b(locale);
      a(locale, parambb);
      localw.f();
    } while (!bool);
  }
  
  public static e a(q paramq, e parame, boolean paramBoolean, bb parambb)
  {
    int j = m.b;
    boolean bool = m.a;
    if (j == 0) {
      if (parambb.size() == 0) {
        return null;
      }
    }
    int[] arrayOfInt = new int[paramq.j()];
    w localw = parambb.l();
    e locale1 = localw.d();
    if ((j != 0) || (locale1 == parame)) {
      return parame;
    }
    int i = 1;
    if (locale1 != parame) {}
    while (j != 0)
    {
      arrayOfInt[locale1.f()] = (i++);
      if (j != 0) {
        break label131;
      }
      locale1 = a(locale1, paramBoolean);
      if (bool) {
        break label120;
      }
      if (!bool) {
        break;
      }
    }
    arrayOfInt[locale1.f()] = i;
    label120:
    e locale2 = a(localw.d(), paramBoolean);
    label131:
    localw.f();
    label293:
    label301:
    label321:
    do
    {
      do
      {
        if ((locale2 == parame) || ((j == 0) && (!localw.e()))) {
          break;
        }
        locale1 = localw.d();
        if ((j != 0) || (locale1 == parame)) {
          return parame;
        }
        if (j == 0) {
          if (arrayOfInt[locale1.f()] >= arrayOfInt[locale2.f()])
          {
            locale2 = a(locale1, paramBoolean);
            if (j != 0) {
              continue;
            }
            if (!bool) {
              break label321;
            }
          }
        }
        do
        {
          if (arrayOfInt[locale1.f()] != 0) {
            break;
          }
          arrayOfInt[locale1.f()] = 1;
          locale1 = a(locale1, paramBoolean);
          if (j != 0) {
            break label301;
          }
          if (bool) {
            break label293;
          }
        } while (!bool);
        if ((j == 0) && (j == 0))
        {
          if (arrayOfInt[locale1.f()] != 1) {
            if (j != 0) {
              continue;
            }
          }
        }
        else if (arrayOfInt[locale1.f()] > arrayOfInt[locale2.f()]) {
          locale2 = locale1;
        }
        localw.f();
      } while (!bool);
    } while (j != 0);
    return locale2;
  }
  
  private static e a(e parame, boolean paramBoolean)
  {
    return paramBoolean ? parame.i().e() : parame.h().f();
  }
  
  public static void b(q paramq, x paramx)
  {
    e locale = h(paramq);
    b(locale, paramx);
  }
  
  public static void c(q paramq, x paramx)
  {
    e locale = h(paramq);
    a(locale, paramx);
  }
  
  private static int a(e parame, x paramx)
  {
    int j = m.b;
    boolean bool = m.a;
    int i = 1;
    d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.f();
      i += a(locale, paramx);
      locald = locald.i();
      if (j != 0) {
        break label70;
      }
      if (bool) {
        return i;
      }
    } while (!bool);
    if (j == 0) {
      paramx.a(parame, i);
    }
    label70:
    return i;
  }
  
  private static int b(e parame, x paramx)
  {
    int j = m.b;
    boolean bool = m.a;
    int i = 0;
    d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.f();
      i = Math.max(i, b(locale, paramx));
      locald = locald.i();
      if (j != 0) {
        break label76;
      }
      if (bool) {
        break label73;
      }
    } while (!bool);
    if (j == 0) {
      paramx.a(parame, i + 1);
    }
    label73:
    label76:
    return i + 1;
  }
  
  static class b_
    extends h
  {
    b_()
    {
      a(false);
    }
    
    protected void a(d paramd, e parame, boolean paramBoolean)
    {
      if (!paramBoolean) {
        throw new a(null);
      }
    }
    
    protected void a(e parame)
    {
      throw new a(null);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.a.kb

 * JD-Core Version:    0.7.0.1

 */